package controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import rulebase.RuleListWindow;
import view.MainFrame;


public class RuleController 
{
	private MainFrame main;
	private RuleListWindow RLW;
	private AddEditRuleController AERC;
	
	public RuleController()
	{
		main = MainFrame.getInstance();
		main.setRuleListListener(new RuleListListener());
	}
	
	public class RuleListListener implements ActionListener
	{
		public void actionPerformed(ActionEvent arg0) 
		{
			RLW = new RuleListWindow();
			RLW.setAddRuleListener(new AddRuleListener());
			RLW.setCancelListener(new CancelListener());
		}
	}
	
	public class AddRuleListener implements ActionListener
	{
		public void actionPerformed(ActionEvent arg0)
		{
			AERC = new AddEditRuleController();
		}	
	}
	
	public class CancelListener implements ActionListener
	{
		public void actionPerformed(ActionEvent e) 
		{
			RLW.dispose();
		}
	}
}
